<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['项目管理','违流事件记录']" icon="fa fa-smile-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>违流事件记录</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
                                <sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)"  [specifyTime]='initDateRange'></table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="showAddUserModal(projectEventModal)">添加</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="tableParam.searchKey" (change)="table_search()" class="search-input" placeholder="公司名称、订单编码、备注">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>所属厂区</th>
										<th>车牌号码</th>
										<th>订单编号</th>
										<th>订单进厂时间</th>
										<th>客户处罚图片</th>
										<th>违流订单图片</th>
										<th>备注</th>
										<th>最后操作人</th>
										<th>最后操作时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.companyName}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.orderCode}}</td>
										<td>{{row.emptyLoadTime}}</td>
										<td>
										    <button *ngIf="row.punishImage" type="button" (click)="showImg1(row.punishImage,imgModal,'客户处罚图片')">查看</button>
										</td>
										<td>
                                            <button *ngIf="row.violationImage" type="button" (click)="showImg1(row.violationImage,imgModal,'违流订单图片')">查看</button>
                                        </td>
										<td>{{row.remark}}</td>
										<td>{{row.updateUser}}</td>
										<td>{{row.updateTime}}</td>
										<td>
											<button type="button" (click)="editRow(row,projectEventModal)">编辑</button>
											<button type="button" (click)="delRow(row)">删除</button>
											<button type="button" (click)="jumpRow(row)">跳转订单</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>

<!-- 新增项目车辆   弹窗-->
<section bsModal #projectEventModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" (click)="closeProjectEventModal(projectEventModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
				<h4 class="modal-title"><span *ngIf="formType == 'add'">新增</span><span *ngIf="formType == 'update'">编辑</span>违流事件</h4>
			</div>
			<form id="projectEventForm"  class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
				<div class="modal-body">
					<div class="row form-horizontal">
                        <div class="form-group col-xs-12 s_fix_select2 s_fix_select2_width">
                            <label class="control-label col-xs-3">车牌号码<sup>*</sup></label>
                            <div class="col-xs-9" >
                                <input type="hidden" *ngIf="formType == 'add'" class="form-control" name="carNumberFrom" id="carNumberFrom" [(ngModel)]='eventForm.carNumber'/>
                                <sa-select2 select2ElementID="carSelect2" *ngIf="formType == 'add'" (optionSelected)="optionSelected($event)" matchSearch="true"></sa-select2>
                                <input  *ngIf="formType == 'update'"  class="form-control" name="carNumberFrom" id="carNumberFrom" [(ngModel)]='eventForm.carNumber' disabled/>
                            </div>
                        </div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">所属厂区<sup>*</sup></label>
							<div class="col-xs-9">
							    <input class="form-control" *ngIf="formType == 'update'" name="companyName" id="companyNameForm" autocomplete="off" [(ngModel)]='eventForm.companyName'  disabled/>
							    <sa-company-tree *ngIf="formType == 'add'" companyTreeId="companyTreeForm" [Height]="32" [companyNameValue]="eventForm.companyName" [companyIdValue]="eventForm.companyId" (companySelected)="companySelectedForm($event)"></sa-company-tree>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">订单编号<sup>*</sup></label>
							<div class="col-xs-9" >
								<input class="form-control" name="orderCode" autocomplete="off" [(ngModel)]='eventForm.orderCode' placeholder="订单编号" [disabled]="formType == 'update'"/>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">订单进厂时间<sup>*</sup></label>
							<div class="col-xs-9" >
								<input class="form-control" name="emptyLoadTime" autocomplete="off" [(ngModel)]='eventForm.emptyLoadTime' placeholder="进厂时间[格式yyyy-mm-dd hh:ii:ss]" />
							</div>
						</div>
						<div class="form-group col-xs-12">
                            <label class="control-label col-xs-3">备注</label>
                            <div class="col-xs-9" >
                                <input class="form-control" name="remark" autocomplete="off" [(ngModel)]='eventForm.remark' placeholder="备注" />
                            </div>
                        </div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3 no-padding-right">客户处罚图片</label>
							<div class="col-xs-9">
								<div class="imgFileList viewerArr1">
									<div class="imgFileList-other">
										<div class="imgFileList-multifile">
											<div class="uploadlocation uploadlocation1"> 
												<div class="content-list">
													<div class="headImg" *ngFor="let item of imageInfo.punishImage; let i = index">
														<div class="contentImg"><img class="img" alt="客户处罚图片"  [src]="item" (click)="bigImgClick('viewerArr1')"></div>
															<i class="deleteImg" (click)="deleteImg('客户处罚图片',i)"></i>
													</div>
													<button type="button"  class="btn div_imgall">
														<div class="div_shuline"></div>
														<div class="div_hengline"></div>
														<input type="file" class="up" title=" " placeholder=" "  multiple (change)="multifileChange($event.target.files,'客户处罚图片')"/>
													</button>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
                        <div class="form-group col-xs-12" style="margin-bottom: 0;">
                            <label class="control-label col-xs-3 no-padding-right">违流订单图片</label>
                            <div class="col-xs-9">
                                <div class="imgFileList viewerArr2">
                                    <div class="imgFileList-other">
                                        <div class="imgFileList-multifile">
                                            <div class="uploadlocation uploadlocation1"> 
                                                <div class="content-list">
                                                    <div class="headImg" *ngFor="let item of imageInfo.violationImage; let i = index">
                                                        <div class="contentImg"><img class="img" alt="违流订单图片"  [src]="item" (click)="bigImgClick('viewerArr2')"></div>
                                                            <i class="deleteImg" (click)="deleteImg('违流订单图片',i)"></i>
                                                    </div>
                                                    <button type="button"  class="btn div_imgall">
                                                        <div class="div_shuline"></div>
                                                        <div class="div_hengline"></div>
                                                        <input type="file" class="up" title=" " placeholder=" "  multiple (change)="multifileChange($event.target.files,'违流订单图片')"/>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="closeProjectEventModal(projectEventModal)">取消</button>
					<button type="button" class="btn btn-primary" (click)="projectEventSubmit(projectEventModal)">确认</button>
				</div>
			</form>
		</div>


	</div>
</section>
<!-- 新增项目车辆 弹窗end-->

<!-- 图片查看   弹窗-->
<section bsModal #imgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content" style="width: 570px;">
			<div class="modal-header">
				<button type="button" class="close" (click)="closeImgModal1(imgModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
				<h4 class="modal-title">{{imgName}}</h4>
			</div>
			<div class="modal-body">
				<div class="imagesInfo1">
					<div class="imgShow" *ngFor="let item of imgLocalList" (click)="bigimg()">
						<img [src]="item" [attr.alt]="imgName"  style="cursor: pointer;"/>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<!-- 图片查看 弹窗end-->